package ch07.home;

class Exercise7_23 {
	// <1
	static double sumArea(Shape[] arr) {
		double sum = 0;
		for (int i = 0; i < arr.length; i++)
			sum += arr[i].calcArea();
		return sum;
	}
	// 1>

	public static void main(String[] args) {
		Shape[] arr = { new Circle22(5.0), new Rect(3, 4), new Circle22(1) };
		System.out.println("면적 합: " + sumArea(arr)); // 면적 합: 93.68140899333463
	}
}
